<template>
  <div
    class="text-20px"
    @click="asd"
  >
    <div>
      <div
        class="i-mdi:account-cowboy-hat"
      />
      Hi Vue3
      <div>{{ data?.data.source }}</div>
    </div>
  </div>
</template>
<script setup lang="ts">
// const { data } = await useFetch<{
//   answer: string;
//   forced: boolean;
//   image: string;
// }>('/api/yesno')
// console.log(data.value)
import type { chouq } from '@/server/api/za'

const { data, send } = await useRequest(alova.Get<chouq>('/api/za'), {
  // 请求响应前，data的初始值
  initialData: {
    data: {},
    code: 0,
    text: ''
  }
})

const asd = async () => {
  send()
}
</script>

<style scoped lang="scss">

</style>
